package com.springcloud.auth.config;

/**
 * oauth2 相关静态变量
 */
public class OauthConfig {
	
	//秒级存储单位
	public final static Integer SESSION_EXPIRE = 60 * 15;
	public final static Integer ACCESS_TOKEN_EXPIRE = 60 * 15;
	public final static Integer REFRESH_TOKEN_EXPIRE = 60 * 30;
	public final static Integer CODE_EXPIRE = 60 * 10;
	
	//鉴权接口
	public final static String GET_ACCESS_TOKEN_URL = "/oauth/getAccessToken";
	public final static String AUTH_URL = "/oauth/redirectToRequestAuthorizationCodeURL";
	public final static String RESOURCE_URL = "/resource/getResource";
	
	//redis key命名
	public final static String AUTH_KEY_PREFIX  = "token:auth-";	//前缀
	public final static String AUTH_ACCESS_TOKEN = AUTH_KEY_PREFIX + "acToken-";
	public final static String AUTH_REFRESH_TOKEN = AUTH_KEY_PREFIX + "reToken-";
	
	//保存在session里面的参数名称
	public final static String SESSION_TOKEN = "session-token";
	
	//保存在TokenEntity key命名
	public final static String TOKEN_KEY_PREFIX  = "token-";	//前缀
	public final static String TOKEN_USER_ID = TOKEN_KEY_PREFIX + "userId";
	public final static String TOKEN_SESSION_ID = TOKEN_KEY_PREFIX + "sessionId";
	public final static String TOKEN_ACCESS_TOKEN = TOKEN_KEY_PREFIX + "acToken";
	public final static String TOKEN_REFRESH_TOKEN = TOKEN_KEY_PREFIX + "reToken";
	
}
